package com.viptail.xiaogouzaijia.view.base;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.hannesdorfmann.mosby.mvp.MvpFragment;
import com.viptail.xiaogouzaijia.presenter.base.BaseRetrofitPresenter;

import butterknife.ButterKnife;

/**
 * A simple {@link Fragment} subclass.
 */
public abstract class BaseFragment<T> extends MvpFragment<BaseRetrofitView<T>, BaseRetrofitPresenter<T>> implements BaseRetrofitView<T> {

    public View view;

    public BaseFragment() {
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        view = inflater.inflate(getLayoutId(), container, false);

        ButterKnife.bind(this, view);
        initView();
        initData();
        return view;
    }



    protected abstract int getLayoutId();

    abstract public void initView();

    abstract public void initData();

}
